package com.example.springbatchdemo.utils;
import org.stringtemplate.v4.ST;
import org.stringtemplate.v4.STGroup;
import org.stringtemplate.v4.STGroupFile;

public class ReadDataUtil {
    /**
     * @return
     **/
    public  String getData(){
        String data = "";
        try {
            STGroup stg = new STGroupFile("templates/data.stg");
            // 获取模板名并渲染
            ST tableST = stg.getInstanceOf("data");
            //获得结果
            data = tableST.render();
        }catch (Exception e){
            e.printStackTrace();
        }
        return data;
    }
}
